package com.example.tests;

import com.thoughtworks.selenium.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
import java.util.regex.Pattern;

public class childcareTestCase {
	private Selenium selenium;

	@Before
	public void setUp() throws Exception {
		selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://220.247.235.183/childcare/");
		selenium.start();
	}

	@Test
	public void testChildcareTestCase() throws Exception {
		selenium.open("/childcare/");
		selenium.type("id=signin_username", "admin");
		selenium.type("id=signin_password", "admin");
		selenium.type("id=signin_password", "admin");
		selenium.click("id=signin_0");
		selenium.waitForPageToLoad("30000");
		verifyEquals("Chidren's Home", selenium.getText("css=#div_844195705 > div > table > tbody > tr"));
		verifyEquals("Chidren's Home", selenium.getText("css=#div_716754032 > div > table > tbody > tr > td.sub-title"));
	}

	@After
	public void tearDown() throws Exception {
		selenium.stop();
	}
}
